package com.zhuifeng.smart.daoimpl;

import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import com.zhuifeng.smart.dao.WebsTypeDao;
import com.zhuifeng.smart.model.WebsType;
import com.zhuifeng.smart.util.JdbcUtil;

public class WebsTypeDaoImpl implements WebsTypeDao {
	private static QueryRunner runner = new QueryRunner(
			JdbcUtil.getDataSource());

	@Override
	public List<WebsType> getWebsTypeList() {
		String sql = "select * from webs_type";
		try {
			return runner.query(sql, new BeanListHandler<WebsType>(
					WebsType.class));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
